package com.usian.admin.controller;

import com.usian.admin.service.AdUserService;
import com.usian.apis.admin.LoginControllerApi;
import com.usian.model.admin.dtos.AdUserDto;
import com.usian.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("login")
@Api(value = "登录管理" ,tags = "Login", description = "登录管理API")
public class LoginController implements LoginControllerApi {
    @Autowired
    private AdUserService adUserService;


    @Override
    @PostMapping("in")
    @ApiOperation(value = "登录管理",notes = "登录管理")
    @ApiImplicitParam(name = "adUser",type ="AdUser")
    public ResponseResult login(@RequestBody AdUserDto dto) {
        return adUserService.login(dto);
    }

    @PostMapping("demo")
    @ApiOperation(value = "token测试", notes = "token测试")
    @ApiImplicitParam(paramType = "header")
    public String demo(){
        return "提莫队长，正在送命……";
    }
}
